home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <exec/libraries.h>
- #include <intuition/intuition.h>
- #include <intuition/screens.h>
- #include <cybergraphics/cybergraphics.h>
- #include <clib/exec_protos.h>
- #include <clib/intuition_protos.h>
- #include <cybergraphics/cybergraphics_protos.h>
-
- struct Library *CyberGfxBase;
- struct Library *IntuitionBase;
-
-
- main()
- {
- struct Screen *testscreen;
- UBYTE *fb; /* the frame buffer */
- ULONG DispID;
- int x;
-
- if (!(IntuitionBase = OpenLibrary("intuition.library",39))) {
- printf("Can't open intuition.library v39!\n");
- exit(0);
- }
- if (CyberGfxBase = OpenLibrary("cybergraphics.library",40)) {
- /* pops up a screen mode requester */
- if (DispID = CModeRequestTags(NULL,TAG_DONE)) {
- if (testscreen = OpenScreenTags(
- NULL,
- SA_Left,0,
- SA_Top,0,
- SA_Width,GetCyberIDAttr(CYBRIDATTR_WIDTH,DispID),
- SA_Height,GetCyberIDAttr(CYBRIDATTR_HEIGHT,DispID),
- SA_Depth,GetCyberIDAttr(CYBRIDATTR_DEPTH,DispID),
- SA_Quiet,TRUE,
- SA_Type,CUSTOMSCREEN,
- SA_DisplayID,DispID,
- TAG_DONE)) {
- fb = (UBYTE *)GetCyberMapAttr(testscreen->RastPort.BitMap,
- CYBRMATTR_DISPADR);
- printf("Frame Buffer = 0x%08lx\n",(unsigned long)fb);
- /* write a test pattern */
- for (x=0; x<=0xff; x++)
- *fb++ = x;
- Delay(250); /* wait 5s */
- CloseScreen(testscreen);
- }
- }
- CloseLibrary(CyberGfxBase);
- }
- else
- printf("Can't open cybergraphics.library v40!\n");
- CloseLibrary(IntuitionBase);
- }
-